package com.java_foundation.huawei.Test_12;

import java.util.Scanner;

/**
 * @program: java_foundation
 * @description: 输入一个int型的正整数，计算出该int型数据在内存中存储时1的个数。
 * @author: xiongbangwen <Email>xiongbangwen@163.com</Email>
 * @create: 2020-08-03 00:11
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int num = sc.nextInt();
            int count = 0;
            String str = Integer.toBinaryString(num);
            for (int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                if (c == '1') {
                    ++count;
                }
            }
            System.out.println(count);
        }
    }
}
